package com.yunquan.ohana.utils

data class ColorData(
    var name: String = "", // 颜色名称
    var normal: String = "", // 默认颜色
    var inner: String = "", // 内边框颜色
    var outer: String = "", // 外边框颜色
    var back: String = "", // 消息背景颜色
    var normalText: String = "#545454",
    var checkText: String = "#FFFFFF",
    var white: String = "#FFFFFF",
)

val COLOR_NAME = arrayOf(
    "orange", "blue", "purple", "brightGreen", "yellow",
    "red", "pink", "green", "lightPurple", "cyan"
)

object ColorUtil {
    private val colorDataList = mutableListOf<ColorData>()

    init {
        // 1.粉色
        var data = ColorData()
        data.name = "pink"
        data.back = "#FFF2F8"
        data.normal = "#FED5E8"
        data.inner = "#FF69B2"
        data.outer = "#FED5E8"
        colorDataList.add(data)
        // 2.紫色
        data = ColorData()
        data.name = "purple"
        data.back = "#F9F3FF"
        data.normal = "#EFDFFF"
        data.inner = "#B261FF"
        data.outer = "#EFDFFF"
        colorDataList.add(data)
        // 3.亮绿色
        data = ColorData()
        data.name = "brightGreen"
        data.back = "#EEFFF9"
        data.normal = "#CEFFEE"
        data.inner = "#19E9A4"
        data.outer = "#CEFFEE"
        colorDataList.add(data)
        // 4.黄色
        data = ColorData()
        data.name = "yellow"
        data.back = "#FFFDE4"
        data.normal = "#FFFAB1"
        data.inner = "#EFE231"
        data.outer = "#FFF99F"
        colorDataList.add(data)
        // 5.红色
        data = ColorData()
        data.name = "red"
        data.back = "#FFEFEF"
        data.normal = "#FFB9B9"
        data.inner = "#FF6868"
        data.outer = "#FFB9B9"
        colorDataList.add(data)
        // 6.绿色
        data = ColorData()
        data.name = "green"
        data.back = "#F0FFE3"
        data.normal = "#CAEFA9"
        data.inner = "#8AEF31"
        data.outer = "#CAEFA9"
        colorDataList.add(data)
        // 7.青蓝色
        data = ColorData()
        data.name = "cyan"
        data.back = "#E9FFFE"
        data.normal = "#B6F5F2"
        data.inner = "#60F0E9"
        data.outer = "#B6F5F2"
        colorDataList.add(data)
        // 8.浅紫色
        data = ColorData()
        data.name = "lightPurple"
        data.back = "#F1F0FF"
        data.normal = "#C8C4FF"
        data.inner = "#8C84FF"
        data.outer = "#C8C4FF"
        colorDataList.add(data)
        // 9.蓝色
        data = ColorData()
        data.name = "blue"
        data.back = "#E5F5FF"
        data.normal = "#BFE7FF"
        data.inner = "#31AEFD"
        data.outer = "#BFE7FF"
        colorDataList.add(data)
        // 10.橘色
        data = ColorData()
        data.name = "orange"
        data.back = "#FFF5EB"
        data.normal = "#FFE0C0"
        data.inner = "#FFAC59"
        data.outer = "#FFE0C0"
        colorDataList.add(data)
    }

    fun getColor(colorIndex: Int): ColorData {
        val colorName = COLOR_NAME[colorIndex]
        colorDataList.forEach { data ->
            if (data.name == colorName) return data
        }
        return ColorData()
    }
}